<template>
      <div>
       
          <div >
         <span>
                选择时间
            <a-range-picker size="small" style="width:200px" @change="onChange" />状态
            <a-select
             placeholder="请选择"
              size="small"
              style="width: 80px "
              @change="handleChange"
            >
              <a-select-option value="审核通过">审核通过</a-select-option>
              <a-select-option value="审核中">审核中</a-select-option>
              <a-select-option value="审核不通过">审核不通过</a-select-option>
              <a-select-option value="待提交">待提交</a-select-option>
            </a-select>
         </span>
          <span v-if="type !=='Municipal'">
                请假类型
               <a-select
            placeholder="请选择"
              size="small"
              style="width: 80px"
              @change="handleChange"
            >
              <a-select-option value="事假">事假</a-select-option>
              <a-select-option value="公休假">公休假</a-select-option>
              <a-select-option value="病假">病假</a-select-option>
              <a-select-option value="婚嫁">婚嫁</a-select-option>
                <a-select-option value="丧家">丧家</a-select-option>
            </a-select>
          </span>
       
              <span class="controlBtn">
                    <a-button type="primary" size="small" style="margin-right:20px">查询</a-button>
                <a-button size="small" style="margin-right: 20px;">重置</a-button>
                <a-button type="primary" icon="plus" size="small" style="margin-right:20px;">请假申请</a-button>
              </span>
    
          </div>
          <a-table size="small" style="margin-top:20px" :columns="type ==='Municipal'?Municipal_columns:other_colums" :data-source="type ==='Municipal'?Municipal_data:other_data">
            <span slot="actions" class="actions">
              <a href>撤销</a>
              <a href>详情</a>
              <a href>销假</a>
              <a href>编辑</a>
              <a href>删除</a>
            </span>
          </a-table>
    </div>
</template>
<script>
import { PAGINATION, TABLE_STATUS_CELL } from '@zt/zongheng-pro/framework/constants'
const Municipal_columns = [
  {
    title: '姓名',
    align: "center",
    dataIndex: 'name',
    key: 'name',
  },
  {
    title: '职务',
    align: "center",
    dataIndex: 'age',
    key: 'age',
  },
  {
    title: '性别',
    align: "center",
    dataIndex: 'sex',
    key: 'sex',
  },
  {
    title: '年龄',
    align: "center",
    key: 'age',
    dataIndex: 'age',
  },
  {
    title: '事由',
    align: "center",
    key: 'reason',
    dataIndex: 'reason',
  },
  {
    title: '开始时间',
    align: "center",
    key: 'startTime',
    dataIndex: 'startTime',
  },
  {
    title: '结束时间',
    align: "center",
    key: 'endTime',
    dataIndex: 'endTime',
  },
  {
    title: '请假天数',
    align: "center",
    key: 'leaveDays',
    dataIndex: 'leaveDays',
  },
  {
    title: '完成时间',
    align: "center",
    key: 'finishTime',
    dataIndex: 'finishTime',
  },
  {
    title: '状态',
    align: "center",
    key: 'status',
    dataIndex: 'status',
  },
  {
    title: '操作',
    align: "center",
    width:'200px',
    key: 'actions',
    dataIndex: 'actions',
    scopedSlots: { customRender: 'actions' }
  },

];
const other_colums=[
     {
    title: '姓名',
    align: "center",
    dataIndex: 'name',
    key: 'name',
  },
   {
    title: '单位',
    align: "center",
    dataIndex: 'department',
    key: 'department',
  },
  {
    title: '职务',
    align: "center",
    dataIndex: 'position',
    key: 'position',
  },
  {
    title: '休假类型',
    align: "center",
    key: 'leaveType',
    dataIndex: 'leaveType',
  },
  {
    title: '事由',
    align: "center",
    key: 'reason',
    dataIndex: 'reason',
  },
  {
    title: '开始时间',
    align: "center",
    key: 'startTime',
    dataIndex: 'startTime',
  },
  {
    title: '结束时间',
    align: "center",
    key: 'endTime',
    dataIndex: 'endTime',
  },
  {
    title: '请假天数',
    align: "center",
    key: 'leaveDays',
    dataIndex: 'leaveDays',
  },
  {
    title: '完成时间',
    align: "center",
    key: 'finishTime',
    dataIndex: 'finishTime',
  },
  {
    title: '状态',
    align: "center",
    key: 'status',
    dataIndex: 'status',
  },
  {
    title: '操作',
    align: "center",
    width:'200px',
    key: 'actions',
    dataIndex: 'actions',
    scopedSlots: { customRender: 'actions' }
  },

];

const Municipal_data = [
  {
    key: '1',
    name: 'John Brown',
    position: "民警",
    age: 32,
    sex: '男',
    reason: '有事',
    startTime: '2020-1-3 18:30',
    endTime: '2020-1-3 18:30',
    leaveDays: "9",
    finishTime: '2020-1-3 18:30',
    status: "审核中",
    actions: ['nice', 'developer'],
  },
  {
    key: '2',
    name: 'John Brown',
    position: "民警",
    age: 32,
    sex: '男',
    reason: '有事',
    startTime: '2020-1-3 18:30',
    endTime: '2020-1-3 18:30',
    leaveDays: "9",
    finishTime: '2020-1-3 18:30',
    status: "审核中",
    actions: ['nice', 'developer'],
  },
  {
    key: '3',
    name: 'John Brown',
    position: "民警",
    age: 32,
    sex: '男',
    reason: '有事',
    startTime: '2020-1-3 18:30',
    endTime: '2020-1-3 18:30',
    leaveDays: "9",
    finishTime: '2020-1-3 18:30',
    status: "审核中",
    actions: ['nice', 'developer'],
  },
];
const other_data = [
  {
    key: '1',
    name: 'John Brown',
    position: "民警",
    leaveType: '有事',
    department: 'xxx',
    reason: '有事',
    startTime: '2020-1-3 18:30',
    endTime: '2020-1-3 18:30',
    leaveDays: "9",
    finishTime: '2020-1-3 18:30',
    status: "审核中",
    actions: ['nice', 'developer'],
  },
  {
    key: '2',
    name: 'John Brown',
    position: "民警",
     leaveType: '有事',
    department: 'xxx',
    reason: '有事',
    startTime: '2020-1-3 18:30',
    endTime: '2020-1-3 18:30',
    leaveDays: "9",
    finishTime: '2020-1-3 18:30',
    status: "审核中",
    actions: ['nice', 'developer'],
  },
  {
    key: '3',
    name: 'John Brown',
    position: "民警",
     leaveType: '有事',
    department: 'xxx',
    reason: '有事',
    startTime: '2020-1-3 18:30',
    endTime: '2020-1-3 18:30',
    leaveDays: "9",
    finishTime: '2020-1-3 18:30',
    status: "审核中",
    actions: ['nice', 'developer'],
  },
];
export default {
    props:["type"],
    data() {
        return {
            pagination: PAGINATION,
            statusCell: TABLE_STATUS_CELL,
            Municipal_columns,
            Municipal_data,
            other_colums,
            other_data
        }
    }
}
</script>
<style>
.controlBtn{
    position: absolute;
    right: 30px;
}
</style>